<template>
    <div class="col-lg-12 col-md-12 col-sm-12">
        <div class="col-lg-12 col-md-12 col-sm-12">
            <div class="col-lg-1 col-md-1 col-sm-1"></div>
            <div class="col-lg-10 col-md-10 col-sm-10">
                <p>收货地址：</p>
                <table class="table">
                    <thead>
                    <tr>
                        <th></th>
                        <th>地址</th>
                        <th>收货人</th>
                        <th>电话</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>
                            <input type="radio" checked="checked" name="Sex" value="male" />
                        </td>
                        <td>郑州航院</td>
                        <td>刘宇飞</td>
                        <td>18939517507</td>
                    </tr>
                </table>
            </div>

        </div>
        <div class="col-lg-12 col-md-12 col-sm-12">
            <div class="col-lg-1 col-md-1 col-sm-1"></div>
            <div class="col-lg-10 col-md-10 col-sm-10">
                <table class="table">
                    <thead>
                    <tr>
                        <th>宝贝</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>小计</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>{{ goods.name }}</td>
                        <td>{{ goods.price/100 }}</td>
                        <td>1</td>
                        <td>{{ goods.price/100 }}</td>
                    </tr>
                    <tr>
                        <td>留言：</td>
                        <td><input type="text"></td>
                        <td>运送方式：快递免邮</td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td></td>
                        <td colspan = "2" >
                            <input type="button" class="price-button" value="立即购买" style="float:right">
                        </td>
                    </tr>
                </table>
            </div>

        </div>
    </div>
</template>
<style>

</style>
<script>

    /**
    *获取路径的参数
    **/
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
        return unescape(r[2]);
        return null;
    }
    export default{
        data(){
            return{
                goods:''
            }
        },
        components:{

        },
        created(){
            var id = getQueryString('id');
            var _this = this;
            this.$http.post('/getgoodsdetail',{'id':id})
                .then(function(res){
                    console.log(res.body);
                    _this.goods = res.body[0]
                });
        },
        methods:{

        }
    }
</script>
